<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    *{
        margin: 0 auto;
        padding: 0;
    }
</style>
<script src="js/jquery-3.4.1.min.js"></script>
<body>
    <form>
        username:<input id="name" type="text" name="name"/><br>
        password:<input id="password" type="password" name="password"/><br>
        <input type="button" value="submit" onclick="login()" />
    </form>
</body>
<script>
    function login() {
            $.ajax({
                url:"/login",
                type:"post",
                data:{
                    "name":$("#name").val(),
                    "password":$("#password").val(),
                },
                success:function(result){
                    if(result.code==200){
                        alert("登录成功 ！ ╰(￣ω￣ｏ)") ;
                    }else{
                        alert("登录失败 ~ ::>_<") ;
                    }
                }
            })
    }
</script>
</html>